/* 
 * File:   Box2dParallelJoint.h
 * Author: Elevator
 *
 * Created on 27 Май 2013 г., 19:59
 */

#ifndef PHYSICS_BOX2DPARALLELJOINT_H
#define PHYSICS_BOX2DPARALLELJOINT_H

#include "Common/Common.h"
#include "IParallelJoint.h"
#include "Physics/Bodies/IBody.h"
#include "Physics/Bodies/Box2dBody.h"

class b2PrismaticJoint;

namespace physics {

	class Box2dParallelJoint : public IParallelJoint {
	public:
		Box2dParallelJoint(
			Box2dBody* bodyA, Box2dBody* bodyB,
			b2PrismaticJoint* joint );
		virtual ~Box2dParallelJoint( );

		virtual IBody* GetBodyA( ) const;
		virtual IBody* GetBodyB( ) const;

		virtual Vec2 GetAnchorA( ) const;
		virtual Vec2 GetAnchorB( ) const;

		virtual Vec2 GetAxis( ) const;

		virtual bool IsLimitEnabled( ) const;
		virtual void SetLimitEnabled( bool enableLimit );

		virtual float GetLeftLimit( ) const;
		virtual void SetLeftLimit( float leftLimit );

		virtual float GetRightLeftLimit( ) const;
		virtual void SetRightLimit( float rightLimit );

		virtual bool IsMotorEnabled( ) const;
		virtual void SetMotorEnabled( bool enableMotor );

		virtual float GetMotorForce( ) const;
		virtual void SetMotorForce( float force );

		virtual float GetMotorSpeed( ) const;
		virtual void SetMotorSpeed( float speed );

		b2PrismaticJoint* GetBox2dJoint( );

	private:
		Box2dBody* _bodyA;
		Box2dBody* _bodyB;
		b2PrismaticJoint* _joint;
	};
}
#endif	/* BOX2DPARALLELJOINT_H */

